package com.reebake.ideal.captcha.config;

import com.reebake.ideal.captcha.controller.CaptchaClientController;
import com.reebake.ideal.captcha.controller.CaptchaController;
import com.reebake.ideal.captcha.core.SmartCaptchaService;
import com.reebake.ideal.captcha.handler.DefaultSmartCaptchaService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@EnableConfigurationProperties()
@Import({CaptchaController.class, CaptchaClientController.class, com.anji.captcha.config.AjCaptchaAutoConfiguration.class})
public class CaptchaAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    SmartCaptchaService smartCaptchaService() {
        return new DefaultSmartCaptchaService();
    }

}
